-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: determine connected components #34
feat: determine connected components #34
Conversation
b921321
to
14b0707
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few comments. You have also made a lot of changes to Thijs' code. Please request a review from him.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a quick review because I don't have a lot of time. I left some comments but didn't review the code in depth.
59ac5aa
to
995efeb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overal. Had a few nitpicks.
if (cell.Tile.CanConnectInDirection(East) && neighbour.X > cell.X && neighbour.Tile.CanConnectInDirection(West)) | ||
connectedNeighbours.Add(neighbour); | ||
else if (cell.Tile.CanConnectInDirection(West) && neighbour.X < cell.X && neighbour.Tile.CanConnectInDirection(East)) | ||
connectedNeighbours.Add(neighbour); | ||
else if (cell.Tile.CanConnectInDirection(North) && neighbour.Y > cell.Y && neighbour.Tile.CanConnectInDirection(South)) | ||
connectedNeighbours.Add(neighbour); | ||
else if (cell.Tile.CanConnectInDirection(South) && neighbour.Y < cell.Y && neighbour.Tile.CanConnectInDirection(North)) | ||
connectedNeighbours.Add(neighbour); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand this if statement. They all result in the same code. It seems like this should be a big or statement, hopefully formatted somewhat nicely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're damn right.
8f14356
to
8c40cfe
Compare
This commit allows determining the connected components, and visualises them in the ConnectedComponents scene by coloring the tiles
This prevents primitive blindness. Now code can more easily be read
d59a145
to
c728115
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
🎉 This PR is included in version 3.1.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description
This commit allows determining the connected components, and visualises them in the
ConnectedComponents
scene by coloring the tiles.In the process of doing so, I fixed some orientation bugs in the Tile classes, notably the
Corner
andTSection
.Testability
See for yourself, and good around! Look for the
ConnectedComponents
scene.Checklist